const fs = require('fs')
const path = require('path')

const env = process.env.NODE_ENV === 'production' ? 'prod' : 'dev'

// pacakges 文件夹路径
const root = path.resolve(__dirname, 'packages')



module.exports = fs.readdirSync(root)// 过滤，只保留文件夹
.filter(item => item !== 'header' && fs.statSync(path.resolve(root, item)).isDirectory())// 为每一个文件夹创建对应额配置
.map(item => {
  const webpack = require(path.resolve(root, item, `webpack_config/webpack.${env}.js`))
  console.log(webpack)
  return webpack
})

